<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>FlexGrid</title>
<link rel="stylesheet" type="text/css" href="css/flexigrid.css">
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/flexigrid.js"></script>
<script type="text/javascript" src="json2db.js"></script>
<script src="json2.js"></script>
</head>
<body>

<table id="flex1" style="display:none"></table>

<script type="text/javascript">
	var j2db=new json2Db("users");
	var grid=$("#flex1").flexigrid({
		method:'GET',
		dataType: 'json',
		colModel : [
			{display: 'ID', name : 'id', width : 40, sortable : true, align: 'left'},
			{display: 'First Name', name : 'name', width : 150, sortable : true, align: 'left'},
			{display: 'Surname', name : 'STATE', width : 150, sortable : true, align: 'left'}
		],
		buttons : [
			{name: 'Edit', bclass: 'edit', onpress : doCommand},
			{name: 'Delete', bclass: 'delete', onpress : doCommand},
			{separator: true}
		],		
		sortname: "id",
		sortorder: "asc",
		usepager: true,
		title: "Staff",
		useRp: true,
		rp: 10,
		showTableToggleBtn: false,
		resizable: false,
		width: 700,
		height: 370,
		singleSelect: true
	});
			
function doCommand(){

};

j2db.index({success:function(json){
	alert(grid);
	//grid.addData(json);
}});

			//url: '/simpleJupiter/rest/report_jqdzfhxmgh/?type=findbysql&sql=select * from users',
</script>

</body>
</html>


